<?php
echo $this->Form->create('Photo');
echo $this->Form->input('name');
?>
<div id="divStatus">0 Files Uploaded</div>
<span id="spanButtonPlaceHolder"></span>
<input id="btnCancel" type="button" value="Cancel All Uploads" onclick="swfu.cancelQueue();" disabled="disabled" style="margin-left: 2px; font-size: 8pt; height: 29px;" />
<?php echo $this->Form->end(__('Submit')); ?>
<script type='text/javascript'>
$(function(){
  var settings = {
    flash_url : "/js/swf/Flash/swfupload.swf",
    upload_url: "http://127.0.0.1/users/upload",
    post_params: {"PHPSESSID" : "<?php echo session_id(); ?>"},
    file_size_limit : "100 MB",
    http_success : [201, 202],
    file_types : "*.*",
    file_types_description : "All Files",
    file_upload_limit : 100,
    file_queue_limit : 0,
    custom_settings : {
    progressTarget : "fsUploadProgress",
    cancelButtonId : "btnCancel"
    },
    debug: true,

    // Button settings
    button_image_url: "/img/admin/TestImageNoText_65x29.png",
    button_width: "65",
    button_height: "29",
    button_placeholder_id: "spanButtonPlaceHolder",
    button_text: '<span class="theFont">上传</span>',
    button_text_style: ".theFont { font-size: 16; }",
    button_text_left_padding: 12,
    button_text_top_padding: 3,
    file_post_name: 'Filedata',

    // The event handler functions are defined in handlers.js
    file_queued_handler : fileQueued,
    file_queue_error_handler : fileQueueError,
    file_dialog_complete_handler : fileDialogComplete,
    upload_start_handler : uploadStart,
    upload_progress_handler : uploadProgress,
    upload_error_handler : uploadError,
    upload_success_handler : uploadSuccess,
    upload_complete_handler : uploadComplete,
    queue_complete_handler : queueComplete	// Queue plugin event
  };
  swfu = new SWFUpload(settings);
});
</script>
